#include <stdio.h>
#include <stdlib.h>


unsigned char SpiReverseBitOrder(short va)
{
 /*80484d0:	55                   	push   %ebp
 80484d1:	89 e5                	mov    %esp,%ebp
 80484d3:	83 ec 14             	sub    $0x14,%esp
 80484d6:	8b 45 08             	mov    0x8(%ebp),%eax	// eax = va
 80484d9:	66 89 45 ec          	mov    %ax,-0x14(%ebp)	// (ebp-0x14)=va&0xff */
	short a;
	
 /*80484dd:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax	// eax = 0x34
 80484e1:	c1 e0 07             	shl    $0x7,%eax		// va = 0x34<<0x7
 80484e4:	89 c2                	mov    %eax,%edx		// edx = 0x34<<0x7 */

 /*80484e6:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax	// eax = 0x34
 80484ea:	83 e0 02             	and    $0x2,%eax		// eax = 0x34 & 0x2
 80484ed:	c1 e0 05             	shl    $0x5,%eax		// eax = (0x34&0x2)<<0x5
 80484f0:	09 c2                	or     %eax,%edx*/		// edx = (0x34<<0x7)|(0x34&0x2)<<0x5

 /*80484f2:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax	// eax = 0x34
 80484f6:	83 e0 04             	and    $0x4,%eax		// eax = 0x34&0x4
 80484f9:	c1 e0 03             	shl    $0x3,%eax		// eax = (0x34&0x4)<<0x3
 80484fc:	09 c2                	or     %eax,%edx		// edx = (0x34<<0x7)|(0x34&0x2)<<0x5|(0x34&0x4)<<0x3

 80484fe:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
 8048502:	83 e0 08             	and    $0x8,%eax		// eax = 0x34&0x8
 8048505:	01 c0                	add    %eax,%eax		// eax = (0x34&0x8)<<0x1
 8048507:	09 c2                	or     %eax,%edx		// edx = (0x34&0x8)<<0x1|(0x34<<0x7)|(0x34&0x2)<<0x5|(0x34&0x4)<<0x3

 8048509:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
 804850d:	83 e0 10             	and    $0x10,%eax		// eax = 0x34&0x10
 8048510:	d1 f8                	sar    %eax				// eax = (0x34&0x10)>>0x1
 8048512:	09 c2                	or     %eax,%edx		// edx = (0x34<<0x7)|(0x34&0x2)<<0x5|(0x34&0x4)<<0x3|(0x34&0x8)<<0x1|(0x34&0x10)>>0x1

 8048514:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
 8048518:	83 e0 20             	and    $0x20,%eax		// eax = 0x34&0x20
 804851b:	c1 f8 03             	sar    $0x3,%eax
 804851e:	09 c2                	or     %eax,%edx		// (0x34<<0x7)|(0x34&0x2)<<0x5|(0x34&0x4)<<0x3|(0x34&0x8)<<0x1|(0x34&0x10)>>0x1|(0x34&0x20)>>0x3

 8048520:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
 8048524:	83 e0 40             	and    $0x40,%eax
 8048527:	c1 f8 05             	sar    $0x5,%eax
 804852a:	09 c2                	or     %eax,%edx	// (0x34<<0x7)|(0x34&0x2)<<0x5|(0x34&0x4)<<0x3|(0x34&0x8)<<0x1|(0x34&0x10)>>0x1|(0x34&0x20)>>0x3|(0x34&0x40)>>0x5

 804852c:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
 8048530:	25 80 00 00 00       	and    $0x80,%eax
 8048535:	c1 f8 07             	sar    $0x7,%eax
 8048538:	09 d0                	or     %edx,%eax	// (0x34<<0x7)|(0x34&0x2)<<0x5|(0x34&0x4)<<0x3|(0x34&0x8)<<0x1|(0x34&0x10)>>0x1|(0x34&0x20)>>0x3|(0x34&0x40)>>0x5|(0x34&0x80)>>0x7

 804853a:	88 45 ff             	mov    %al,-0x1(%ebp)
 804853d:	0f b6 45 ff          	movzbl -0x1(%ebp),%eax*/
	a = ((va<<0x7)) 	 | ((va&0x2)<<0x5) |
		((va&0x4)<<0x3)  | ((va&0x8)<<0x1) |
		((va&0x10)>>0x1) | ((va&0x20)>>0x3)|
		((va&0x40)>>0x5) | ((va&0x80)>>0x7);

 /*8048541:	c9                   	leave  
 8048542:	c3                   	ret  */  
	return a;
}

int main()
{
 /*8048543:	55                   	push   %ebp
 8048544:	89 e5                	mov    %esp,%ebp
 8048546:	83 e4 f0             	and    $0xfffffff0,%esp
 8048549:	83 ec 20             	sub    $0x20,%esp
 804854c:	c7 04 24 34 00 00 00 	movl   $0x34,(%esp)
 8048553:	e8 78 ff ff ff       	call   80484d0 <SpiReverseBitOrder>*/
	int a = SpiReverseBitOrder(0x34);

 /*8048558:	0f b6 c0             	movzbl %al,%eax
 804855b:	89 44 24 1c          	mov    %eax,0x1c(%esp)
 804855f:	8b 44 24 1c          	mov    0x1c(%esp),%eax
 8048563:	89 44 24 08          	mov    %eax,0x8(%esp)
 8048567:	c7 44 24 04 17 00 00 	movl   $0x17,0x4(%esp)
 804856e:	00 
 804856f:	c7 04 24 14 86 04 08 	movl   $0x8048614,(%esp)
 8048576:	e8 15 fe ff ff       	call   8048390 <printf@plt>*/
	printf("%d:0x%x\n", 0x17, a);

 /*804857b:	c9                   	leave  
 804857c:	c3                   	ret    
 804857d:	66 90                	xchg   %ax,%ax
 804857f:	90                   	nop*/
}
